<?php
namespace app\admin\controller;
use app\admin\controller\Base;
use think\Db;
class Judge extends Base
{
	
  //显示发布信息列表
  public function lst()
	{  
     $judge=model('judge')->getAll();
     return view('',[
      'judge'=>$judge,
      'page'=>$judge->render(),
      'title'=>'发布信息列表页'
    ]);
	}

  //根据信息搜索所有的评论
  public function search()
  {
    $mname=input('mname');
    $str='%';
    foreach ((mb_str_split($mname)) as $i) {
      $str.=$i.'%';
    }
    $judge=model('judge')->getAllByMname($str);
    return view('lst',[
      'judge'=>$judge,
      'page'=>$judge->render(),
      'title'=>'发布信息列表页',
      'search'=>$mname
    ]);
  }

 


   //删除一个信息
  	public function delete($id)
  	{
        $res=model('user')->deleteBycondition(['id'=>$id]);
        if($res){
          return 1;
        }else{
          return 0;
        }
  	}
      
}